
#ifndef __CHARACTER__
#define __CHARACTER__

#include <vector>


#include "animated_sprite.h"
#include "entity.h"
#include "hud.h"

using std::vector;

/*! \brief Playable character class.
*
* Mother class of playable characters.
*/
class Character : public AnimatedSprite {
  public:
    /*! \brief Class constructor.
    *
    * Initialize memory and define sequences of the character.
    * \param path is the path of the character config file
    */
    Character(const char * path);
    /*! \brief Update the Character.
    *
    */
    virtual void __update() = 0;
    /*! \brief Read the keyboard input.
    *
    */    
    virtual void __readKeyboard() = 0;
    /*! \brief Get a certain item
    *
    * \param id is the Item ID
    * \param value1 is the custom value 1 of the item
    * \param value2 is the custom value 2 of the item
    * \param value3 is the custom value 3 of the item    
    */    
    virtual void __getItem(int id, int value1 = 0, int value2 = 0, int value3 = 0) = 0;
    /*! \brief link the HUD layer to the object.
    *
    * Must be used only once
    * \param HUDVec is the HUD vector pointer
    */
    virtual void __linkHUD(vector<HUD *>* HUDVec) = 0;
    /*! \brief link the Entity vector to the object.
    *
    * \param entVec is the vector pointer
    */
    void __linkEntVec(vector<Entity *>* entVec);
    /*! \brief Damage the character.
    *
    */
    void __hit();
    /*! \brief Heal the character.
    *
    * \param val Integer
    */
    void __heal(int val);
    /*! \brief Get the life of the character.
    *
    * \return an integer value
    */
    int __getLife();

  protected:
    /**
    * integer.
    * Flag variable (see consts.h)
    */
    int _status;
    /**
    * integer.
    * Orientation of the character (LEFT=1/RIGHT=0)
    */
    int _view;
    /**
    * integer.
    * Life of the character
    */
    int _life;
    /**
    * integer array.
    * Horizontal Speed, Vertical Speed are stored in it (pixel per frame)
    */
    int _vec[2];
    /**
    * HUD Object.
    * HUD Life object
    */
    HUD * _HUDLife;
    /**
    * Entity vector
    */
    vector<Entity *>*_entVec;    
};
#endif
